package com.xmkj.carwash.adapter;

import android.content.Context;

import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.xmkj.carwash.R;
import com.xmkj.carwash.bean.CityResultBean;

import java.util.List;


/**
 * Created by Administrator on 2017/11/2.
 */

public class MapCityListAdapter extends CommonAdapter<CityResultBean> {
    List<CityResultBean> list;
    public MapCityListAdapter(Context context, List<CityResultBean> data) {

        super(context, data);
        this.list = data;
    }

    @Override
    protected void convert(ViewHolder holder, CityResultBean item, int position) {
        holder.setText(R.id.shop,item.getName());
        holder.setText(R.id.tv_address,item.getDetail());

        holder.setOnClickListener(R.id.ll_address, new OnItemChildClickListener());

    }

    @Override
    protected int getItemViewLayoutId(int position, CityResultBean item) {
        return R.layout.item_fragment_map_list_city;
    }
    public void setDatas(List<CityResultBean> listBeen) {
        if (listBeen != null) {
            list.addAll(listBeen);
            notifyDataSetChanged();
        }
    }
}
